import { get } from "../../utils/request";
Page({
  data: {
    article: {},
  },
  async onLoad({ id }) {
    // 通过文章的ID查询 文章的详情对象
    let { article } = await get("/article", {
      data: {
        id,
      },
    });
    this.setData({ article });
    wx.setNavigationBarTitle({
      title: article.title,
    });
  },
  previewPoster() {
    wx.previewImage({
      urls: [
        this.data.article.poster,
        this.data.article.poster,
        this.data.article.poster,
      ],
    });
  },
});
